/*
 * 异常设置模块
 */
define("func/abnormalSetting",[
	"leaflet",
    "func/base",
    "control/panel",
    "plugins/ajaxpoll",
    "func/abnormalAlarm",
    "func/aisSetting",
    "func/gatherSetting",
    "func/behaviorSetting",
    "func/areaSetting",
],function(L){

	L.ICT.Func.add("AbnormalSetting",{
		Class: L.Class.extend({
			initialize:function(){
				this.ictmap=L.ict.app.ictmap;
				this.menu=L.ict.app.menu;
				this.menuid='ict_menu_main_ycsz';
				this.config=Project_ParamConfig.abnormalAlarmConfig;
				this.CurrentMode=Project_ParamConfig.CurrentMode;
                this._container = null;
                this._popPanel = null;
                this._data = [];
			},
			start:function(){
				this.stop();
				this.CurrentMode=0;
				if(this._container || this._popPanel) { return; }
				// this._container=$(".menu_main_panel");
				this._initUi();
				this._initEvts();
				this.menu.mainmenu.deactiveMenuExceptOne(this.menuid);
                this.menu.mainmenu.disableMenuExceptOne(this.menuid);
			},
			stop:function(){
				if(this._popPanel) this._popPanel.remove();
                // this.removeLayer();

                this._container = null;
                this._popPanel = null;
                this._data = [];
			},
			_initUi:function(){
				
					this._container=$(".setting_container");
					var html=$(this._getContentHtml());
					this._container.html(html);
				
				
				
			},
			_getContentHtml:function(){
				var html=[];
				// html.push('<div class=setting_container>');
				html.push('<ul class="settingNav">');
				html.push('<li data-info="area_setting"><a href="#" >敏感区域设置</a></li>');
                html.push('<li data-info="behavior_setting"><a href="#">船速设置</a></li>');
                html.push('<li data-info="gather_setting"><a href="#" >区域聚集设置</a></li>');
                html.push('<li data-info="ais_setting"><a href="#" >静默时间设置</a></li>');
                html.push('</ul>');
                // html.push('</div>');
                return html.join("");
			},
			 _initEvts: function () {
                var self = this;
                self._container.find(".settingNav>li").on("click", function (event) {
                	
                    $(this).addClass("active").siblings().removeClass("active");
                    // self.removeLayer();
                    // self._container.find('.tableContainer .tbDiv').remove();
                    var info = $(this).attr("data-info");
                    
                    var url = null;
                    switch(info) {
                        case "area_setting":
                        L.ICT.Func["AreaSetting"].run();
                        
                            break;
                        case "behavior_setting":
                        L.ICT.Func["BehaviorSetting"].run();
                        console.log(2);
                           
                            break;
                        case "gather_setting":
                        L.ICT.Func["GatherSetting"].run();
                       
                            break;
                        case "ais_setting":
                        L.ICT.Func["AisSetting"].run();
                     
                            break;
                       default:;
                    }
               });
            },

		})
	})
})